import 'package:flutter_test/flutter_test.dart';
import 'package:at_auth_plugin/at_auth_plugin.dart';
import 'package:at_auth_plugin/at_auth_plugin_platform_interface.dart';
import 'package:at_auth_plugin/at_auth_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockAtAuthPluginPlatform
    with MockPlatformInterfaceMixin
    implements AtAuthPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final AtAuthPluginPlatform initialPlatform = AtAuthPluginPlatform.instance;

  test('$MethodChannelAtAuthPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelAtAuthPlugin>());
  });

  test('getPlatformVersion', () async {
    AtAuthPlugin atAuthPlugin = AtAuthPlugin();
    MockAtAuthPluginPlatform fakePlatform = MockAtAuthPluginPlatform();
    AtAuthPluginPlatform.instance = fakePlatform;

    expect(await atAuthPlugin.getPlatformVersion(), '42');
  });
}
